/*
 * @Date         : 2024-05-20 13:15:59 星期1
 * @Author       : xut
 * @Description  :
 */
import { z } from "zod"

export const registerUserSchema = z.object({
  body: z.object({
    name: z.string(),
    email: z.string().email(),
    password: z.string(),
    passwordConfirm: z.string().optional().nullable(),
    photo: z.string(),
    provider: z.string().optional().nullable(),
  }),
})

export const loginUserSchema = z.object({
  body: z.object({
    email: z.string().email(),
    password: z.string(),
  }),
})

export const refreshTokenSchema = z.object({
  body: z.object({
    refresh_token: z.string(),
  }),
})

export const verifyEmailSchema = z.object({
  query: z.object({
    verification_code: z.string(),
  }),
})

export type RegisterUserInput = z.infer<typeof registerUserSchema>["body"]
export type LoginUserInput = z.infer<typeof loginUserSchema>["body"]
export type RefreshTokenInput = z.infer<typeof refreshTokenSchema>["body"]
export type VerifyEmailInput = z.infer<typeof verifyEmailSchema>["query"]
